//
//  MSSetTableViewCell.m
//  SocietySale
//
//  Created by yumingwei on 2016/11/2.
//  Copyright © 2016年 Mike. All rights reserved.
//

#import "MSSetTableViewCell.h"

@interface MSSetTableViewCell ()
@end

@implementation MSSetTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initView];
        self.textLabel.font = HeitiFont(15);
    }
    return self;
}

- (void)initView {
    self.subLabel = [[UILabel alloc] initWithFrame:CGRectMake(80, 0, SCREEN_WIDTH-102, self.height)];
    self.subLabel.font = HeitiFont(14);
    self.subLabel.textColor = kLightGrayColor;
    self.subLabel.textAlignment = NSTextAlignmentRight;
    [self.contentView addSubview:self.subLabel];
    
    _horizonLineView =[[UIView alloc] initWithFrame:CGRectMake(12, 43.4, SCREEN_WIDTH-24, 0.6)];
    _horizonLineView.backgroundColor = kNormalGray;
    [self.contentView addSubview:_horizonLineView];
    
    _arrow = [[UIImageView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-20, 14, 8.5, 16.5)];
    _arrow.image = [UIImage imageNamed:@"arrow2"];
    [self.contentView addSubview:_arrow];
}

- (void)setData:(DOKeyValue *)data {
    _data = data;

    self.textLabel.text = _data.key;
    if (_data.value.length) {
        self.subLabel.text = _data.value;
        self.subLabel.textColor = [UIColor blackColor];
    }
    else{
        self.subLabel.text = _data.placeHolder;
        self.subLabel.textColor = UIColorFromRGB(0xb9b9b9);
    }
}

@end
